<template>
	<view class="nav-image-cn">
		<!-- 组件内容 -->
		<view class="cn-content">
			<view class="radius-20 bg-ff">
				<!-- 标题 -->
				<view class="line-height-100 padding-lr-30 border-bottom-ed text-28 text-bold">
					{{title}}
				</view>

				<!-- 应用列表 -->
				<view class="padding-tb-15">
					<view class="flex flex-wrap">
						<view class="padding-tb-15 flex flex-direction align-center width-25p" @click="link(index)"
							v-for="(item,index) in list" :key="index">
							<image class="jc-image-60" :src="item.image" mode="aspectFill"></image>
							<text class="margin-top-15 text-24">{{item.name}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 组件浮层 -->
		<view class="cn-layer">
		</view>
	</view>
</template>

<script>
	import common from '@/components/hzjc/utils/common.js'
	export default {
		props: {
			// 标题
			title: {
				type: String,
				default: '我的应用'
			},
			// 导航项
			list: {
				type: Array,
				default: []
			}
		},

		methods: {
			link(index) {
				if (this.list[index].login && !common.isLogin()) {
					this.$emit('needLogin')
				} else {
					uni.navigateTo({
						url: this.list[index].url
					})
				}
			}
		}
	}
</script>

<style scoped>

</style>